From 7bcf5719508da54fe7ea9f9268a75e1089a02a82 Mon Sep 17 00:00:00 2001 From: Markus Rost Date: Wed, 31 Jul 2002 22:29:00 +0000 Subject: [PATCH] (ediff-backup): New autoloaded command. --- lisp/ediff.el | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lisp/ediff.el b/lisp/ediff.el index 2db82f85547..5b0f85d05cd 100644 --- a/lisp/ediff.el +++ b/lisp/ediff.el @@ -367,6 +367,22 @@ ;;;###autoload (defalias 'ediff 'ediff-files) +;;;###autoload +(defun ediff-backup (file) + "Run Ediff on FILE and its backup file. +Uses the latest backup, if there are several numerical backups. +If this file is a backup, `ediff' it with its original." + (interactive (list (read-file-name "Ediff (file with backup): "))) + ;; The code is taken from `diff-backup'. + (require 'diff) + (let (bak ori) + (if (backup-file-name-p file) + (setq bak file + ori (file-name-sans-versions file)) + (setq bak (or (diff-latest-backup-file file) + (error "No backup found for %s" file)) + ori file)) + (ediff-files bak ori))) ;;;###autoload (defun ediff-buffers (buffer-A buffer-B &optional startup-hooks job-name) -- 2.30.2